package com.study.design.proxy.reflectproxy;

import java.lang.reflect.Proxy;

public class Client {
    public static void main(String[] args) {
        // 真实对象real
        Subject realSubject = new RealSubject();
        // 生成realSubject的代理对象
        Subject subject = (Subject) Proxy.newProxyInstance(Subject.class.getClassLoader(), RealSubject.class.getInterfaces(), new ProxyHandler(realSubject));
        subject.request();
    }
}
